package cs2340.quarterblack.wheresmystuff;

import java.util.List;

import cs2340.quarterblack.wheresmystuff.Item.Itemtype;

public abstract class Storage {
	public enum loginResponse {INVALID_CREDENTIALS, LOCKED_ACCOUNT, ALLOWED};
	private String message;
	
	public Storage() {
	}
	/**
	 * checks to see if the user login is a valid login
	 * @param tempUser the user account with the login information
	 * to be checked
	 * @return one of the enumerated login responses
	 */
	public abstract loginResponse checkLogin(Account tempUser);
	
	/**
	 * adds a new account to the database
	 * @param newUser the user to be added
	 * @return whether or not the user was actually added.
	 */
	public abstract boolean addAccount(Account newUser);
	
	/**
	 * locks the specified account
	 * @param currentUser the account to be locked
	 * @return result whether or not the account was successfully
	 * locked or not
	 */
	public abstract boolean lockAccount(Account currentUser);
	
	/**
	 * unlocks the specified account
	 * @param currentUser the user to be added to the database
	 * @return result whether or not the user was successfully added to the database
	 */
	public abstract boolean unlockAccount(Account currentUser);
	
	/**
	 * adds the indicated item to either a user's lost list
	 * or their found list
	 * @param newItem the item to be added
	 * @return bool whether the item was successfully added or not
	 */
	public abstract boolean addItem(Item foundItem);
	
	/**
	 * sets the privileges of an account
	 * @param id  the id of the account to be added.
	 * @param admin the status of the admin variable the account should be set to
	 * @return whether or not the privileges where changed.
	 */
	public abstract boolean setPrivelages(String id,boolean admin);
	
	/**
	 * deletes the account with the id from the database
	 * @id the id of the account to be deleted
	 */
	public abstract boolean deleteAccount(String id);
	
	/**
	 * returns a list of the user's items
	 * @param currentUser the user who's items should be sent back
	 * @param type the type of item list that should be returned either lost or found
	 */
	public abstract List<Item> getUsersItems(Account currentUser, Itemtype type);
	
	/**
	 * method to give the App the real account, not the one used to login
	 * @param acct the fake account with information needed to access the real account
	 * @return the account being stored in the database
	 */
	public abstract Account getAccount(Account acct);
	
	/**
	 * checks to see if the given id exists in the database
	 * @param id the id to be checked
	 * @return whether or not the id exists 
	 */
	public abstract boolean checkExists(String id);
	
	/**
	 * gets all items in the database
	 */
	public abstract List<Item> getAllItems();
	
	public String getMessage() {
		return message;
	}
}
